import { createApp } from 'vue';

import App from './App.vue';
import router from './router';
import { createPinia } from 'pinia';

import DirectivePermission from './directive/permission';
import DirectiveDecimal from './directive/decimal';

// import 'element-plus/dist/index.css'
// import '@/styles/element/index.scss';
import 'element-plus/theme-chalk/el-message.css';
import 'element-plus/theme-chalk/el-message-box.css';
import 'element-plus/theme-chalk/el-notification.css';
// import '@/styles/css-var.css';
import '@/styles/index.scss';

// 引入 wangeditor css
import '@wangeditor/editor/dist/css/style.css';

//全局进度条的配置
import * as NProgress from 'nprogress';
import 'nprogress/nprogress.css';
NProgress.configure({
  // easing: 'ease',  // 动画方式
  // speed: 1000,  // 递增进度条的速度
  showSpinner: false // 是否显示加载ico
  // trickleSpeed: 200, // 自动递增间隔
  // minimum: 0.3 // 初始化时的最小百分比
});

import PipeDatetime from '@/components/PipeDatetime.vue';
import PipeCount from '@/components/PipeCount.vue';
import PipeMoney from '@/components/PipeMoney.vue';
import PipeResetBtn from '@/components/PipeResetBtn.vue';
import SearchCollapse from '@/components/SearchCollapse.vue';
import PipeImage from '@/components/PipeImage.vue';
import PipeSelectTree from '@/components/PipeSelectTree.vue';
import PipeTags from '@/components/PipeTags.vue';
import ProfilePanel from '@/components/ProfilePanel.vue';

const app = createApp(App);

// 全局组件
app.component('PipeDatetime', PipeDatetime);
app.component('PipeCount', PipeCount);
app.component('PipeMoney', PipeMoney);
app.component('PipeResetBtn', PipeResetBtn);
app.component('SearchCollapse', SearchCollapse);
app.component('PipeImage', PipeImage);
app.component('PipeSelectTree', PipeSelectTree);
app.component('PipeTags', PipeTags);
app.component('ProfilePanel', ProfilePanel);

// 自定义指令
app.directive(DirectivePermission.name, DirectivePermission.directive);
app.directive(DirectiveDecimal.name, DirectiveDecimal.directive);

app.use(createPinia()).use(router).mount('#app');
